@eifi1/ui-kit 0.22.0 → 0.24.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 (208) hide show
  1. package/README.md +42 -25
  2. package/dist/chart.d.ts +8 -7
  3. package/dist/components/amount-input.d.ts +34 -7
  4. package/dist/components/amount-input.js +14 -10
  5. package/dist/components/amount-input.js.map +1 -1
  6. package/dist/components/autocomplete.d.ts +26 -0
  7. package/dist/components/autocomplete.js +164 -137
  8. package/dist/components/autocomplete.js.map +1 -1
  9. package/dist/components/button-group.d.ts +8 -7
  10. package/dist/components/calculator.d.ts +8 -7
  11. package/dist/components/column-mapper.d.ts +235 -0
  12. package/dist/components/column-mapper.js +411 -0
  13. package/dist/components/column-mapper.js.map +1 -0
  14. package/dist/components/combobox-core.d.ts +39 -2
  15. package/dist/components/combobox-core.js +29 -6
  16. package/dist/components/combobox-core.js.map +1 -1
  17. package/dist/components/combobox.d.ts +113 -3
  18. package/dist/components/combobox.js +456 -313
  19. package/dist/components/combobox.js.map +1 -1
  20. package/dist/components/confirm-dialog.d.ts +8 -7
  21. package/dist/components/confirm-dialog.js +7 -8
  22. package/dist/components/confirm-dialog.js.map +1 -1
  23. package/dist/components/copy-button.d.ts +5 -4
  24. package/dist/components/country-select.d.ts +50 -7
  25. package/dist/components/country-select.js +65 -9
  26. package/dist/components/country-select.js.map +1 -1
  27. package/dist/components/danger-confirm.d.ts +8 -7
  28. package/dist/components/danger-confirm.js +64 -7
  29. package/dist/components/danger-confirm.js.map +1 -1
  30. package/dist/components/date-picker.d.ts +41 -0
  31. package/dist/components/date-picker.js +269 -8
  32. package/dist/components/date-picker.js.map +1 -1
  33. package/dist/components/entity-combobox.d.ts +48 -2
  34. package/dist/components/entity-combobox.js +159 -114
  35. package/dist/components/entity-combobox.js.map +1 -1
  36. package/dist/components/facing-pair.d.ts +8 -7
  37. package/dist/components/field-parts.d.ts +116 -6
  38. package/dist/components/field-parts.js +84 -0
  39. package/dist/components/field-parts.js.map +1 -1
  40. package/dist/components/field-strip.d.ts +105 -0
  41. package/dist/components/field-strip.js +46 -0
  42. package/dist/components/field-strip.js.map +1 -0
  43. package/dist/components/file-button.d.ts +8 -7
  44. package/dist/components/file-dropzone.d.ts +8 -7
  45. package/dist/components/form-actions.d.ts +8 -7
  46. package/dist/components/form-actions.js +23 -3
  47. package/dist/components/form-actions.js.map +1 -1
  48. package/dist/components/iban-input.d.ts +8 -7
  49. package/dist/components/icon-picker.d.ts +10 -1
  50. package/dist/components/icon-picker.js +12 -4
  51. package/dist/components/icon-picker.js.map +1 -1
  52. package/dist/components/language-select.d.ts +8 -7
  53. package/dist/components/money-field.d.ts +11 -7
  54. package/dist/components/money-field.js.map +1 -1
  55. package/dist/components/month-picker.js +2 -1
  56. package/dist/components/month-picker.js.map +1 -1
  57. package/dist/components/multi-entity-combobox.d.ts +31 -2
  58. package/dist/components/multi-entity-combobox.js +152 -103
  59. package/dist/components/multi-entity-combobox.js.map +1 -1
  60. package/dist/components/number-field.d.ts +8 -7
  61. package/dist/components/number-input.d.ts +8 -7
  62. package/dist/components/numpad-sheet.d.ts +8 -7
  63. package/dist/components/phone-input.d.ts +8 -7
  64. package/dist/components/reauth-dialog.d.ts +2 -2
  65. package/dist/components/reauth-dialog.js +6 -8
  66. package/dist/components/reauth-dialog.js.map +1 -1
  67. package/dist/components/series-chart.d.ts +8 -7
  68. package/dist/components/settings-fields.d.ts +8 -7
  69. package/dist/components/share-card.d.ts +8 -7
  70. package/dist/components/swatch-picker.d.ts +17 -1
  71. package/dist/components/swatch-picker.js +10 -4
  72. package/dist/components/swatch-picker.js.map +1 -1
  73. package/dist/components/text-link.d.ts +8 -7
  74. package/dist/components/tile-radio.d.ts +20 -0
  75. package/dist/components/tile-radio.js +25 -8
  76. package/dist/components/tile-radio.js.map +1 -1
  77. package/dist/components/time-input.d.ts +8 -7
  78. package/dist/components/toggle-group.js +2 -2
  79. package/dist/components/toggle-group.js.map +1 -1
  80. package/dist/components/trigger-aria.d.ts +3 -0
  81. package/dist/components/trigger-aria.js +3 -1
  82. package/dist/components/trigger-aria.js.map +1 -1
  83. package/dist/components/ui.d.ts +5 -4
  84. package/dist/components/ui.js +60 -28
  85. package/dist/components/ui.js.map +1 -1
  86. package/dist/feedback/feedback-attachment.d.ts +66 -1
  87. package/dist/feedback/feedback-attachment.js +185 -65
  88. package/dist/feedback/feedback-attachment.js.map +1 -1
  89. package/dist/feedback/feedback-dialog.d.ts +66 -1
  90. package/dist/feedback/feedback-dialog.js.map +1 -1
  91. package/dist/feedback/feedback-inbox.d.ts +67 -252
  92. package/dist/feedback/feedback-inbox.js.map +1 -1
  93. package/dist/feedback/feedback-thread.d.ts +66 -287
  94. package/dist/feedback/feedback-thread.js +16 -3
  95. package/dist/feedback/feedback-thread.js.map +1 -1
  96. package/dist/{kit-labels-R8mIAc9N.d.ts → feedback-DOwPu-Il.d.ts} +1273 -30
  97. package/dist/feedback.d.ts +65 -3
  98. package/dist/hooks/use-file-drop.d.ts +8 -7
  99. package/dist/i18n/defaults.d.ts +8 -7
  100. package/dist/i18n/defaults.js +3 -1
  101. package/dist/i18n/defaults.js.map +1 -1
  102. package/dist/i18n/german.d.ts +8 -7
  103. package/dist/i18n/german.js +36 -2
  104. package/dist/i18n/german.js.map +1 -1
  105. package/dist/i18n/kit-labels.d.ts +5 -4
  106. package/dist/i18n/kit-labels.js.map +1 -1
  107. package/dist/i18n/languages.d.ts +8 -7
  108. package/dist/i18n/locales/de-CH.d.ts +8 -7
  109. package/dist/i18n/locales/en.d.ts +8 -7
  110. package/dist/i18n/locales/en.js +7 -0
  111. package/dist/i18n/locales/en.js.map +1 -1
  112. package/dist/i18n/locales/es.d.ts +8 -7
  113. package/dist/i18n/locales/es.js +37 -2
  114. package/dist/i18n/locales/es.js.map +1 -1
  115. package/dist/i18n/locales/fr.d.ts +8 -7
  116. package/dist/i18n/locales/fr.js +36 -2
  117. package/dist/i18n/locales/fr.js.map +1 -1
  118. package/dist/i18n/locales/hu.d.ts +8 -7
  119. package/dist/i18n/locales/hu.js +38 -2
  120. package/dist/i18n/locales/hu.js.map +1 -1
  121. package/dist/i18n/locales/it.d.ts +8 -7
  122. package/dist/i18n/locales/it.js +37 -2
  123. package/dist/i18n/locales/it.js.map +1 -1
  124. package/dist/i18n/locales/zh.d.ts +8 -7
  125. package/dist/i18n/locales/zh.js +34 -2
  126. package/dist/i18n/locales/zh.js.map +1 -1
  127. package/dist/i18n/review.d.ts +8 -7
  128. package/dist/i18n/review.js +20 -1
  129. package/dist/i18n/review.js.map +1 -1
  130. package/dist/index.d.ts +6 -4
  131. package/dist/index.js +16 -0
  132. package/dist/index.js.map +1 -1
  133. package/dist/lib/column-mapping.d.ts +81 -0
  134. package/dist/lib/column-mapping.js +108 -0
  135. package/dist/lib/column-mapping.js.map +1 -0
  136. package/dist/lib/strip-fade.d.ts +2 -2
  137. package/dist/lib/strip-fade.js.map +1 -1
  138. package/dist/lib/table-text.d.ts +109 -1
  139. package/dist/lib/table-text.js +122 -1
  140. package/dist/lib/table-text.js.map +1 -1
  141. package/dist/rhf/fields.d.ts +142 -13
  142. package/dist/rhf/fields.js +185 -3
  143. package/dist/rhf/fields.js.map +1 -1
  144. package/dist/rhf/form.d.ts +8 -7
  145. package/dist/rhf.d.ts +9 -8
  146. package/dist/rhf.js.map +1 -1
  147. package/dist/shell/app-shell.d.ts +8 -7
  148. package/dist/shell/top-bar-brand.d.ts +8 -7
  149. package/dist/shell/topbar-action-menu.d.ts +36 -3
  150. package/dist/shell/topbar-action-menu.js +74 -33
  151. package/dist/shell/topbar-action-menu.js.map +1 -1
  152. package/dist/shell.d.ts +8 -7
  153. package/dist/table-text.d.ts +1 -1
  154. package/dist/wizard/stepper-nav.d.ts +38 -9
  155. package/dist/wizard/stepper-nav.js +4 -0
  156. package/dist/wizard/stepper-nav.js.map +1 -1
  157. package/dist/wizard.d.ts +8 -7
  158. package/package.json +1 -1
  159. package/src/components/amount-input.tsx +50 -14
  160. package/src/components/autocomplete.tsx +188 -116
  161. package/src/components/column-mapper.tsx +768 -0
  162. package/src/components/combobox-core.tsx +82 -9
  163. package/src/components/combobox.tsx +655 -335
  164. package/src/components/confirm-dialog.tsx +12 -8
  165. package/src/components/country-select.tsx +135 -22
  166. package/src/components/danger-confirm.tsx +274 -24
  167. package/src/components/date-picker.tsx +423 -10
  168. package/src/components/entity-combobox.tsx +243 -129
  169. package/src/components/field-parts.tsx +224 -5
  170. package/src/components/field-strip.tsx +149 -0
  171. package/src/components/form-actions.tsx +52 -5
  172. package/src/components/icon-picker.tsx +23 -4
  173. package/src/components/money-field.tsx +3 -0
  174. package/src/components/month-picker.tsx +2 -1
  175. package/src/components/multi-entity-combobox.tsx +221 -121
  176. package/src/components/reauth-dialog.tsx +17 -18
  177. package/src/components/swatch-picker.tsx +29 -5
  178. package/src/components/tile-radio.tsx +74 -13
  179. package/src/components/toggle-group.tsx +2 -2
  180. package/src/components/trigger-aria.ts +5 -0
  181. package/src/components/ui.tsx +114 -33
  182. package/src/feedback/feedback-attachment.tsx +372 -72
  183. package/src/feedback/feedback-dialog.tsx +7 -3
  184. package/src/feedback/feedback-inbox.tsx +3 -2
  185. package/src/feedback/feedback-thread.tsx +112 -9
  186. package/src/i18n/defaults.ts +2 -0
  187. package/src/i18n/german.ts +42 -0
  188. package/src/i18n/kit-labels.tsx +4 -0
  189. package/src/i18n/locales/en.ts +27 -5
  190. package/src/i18n/locales/es.ts +41 -0
  191. package/src/i18n/locales/fr.ts +42 -0
  192. package/src/i18n/locales/hu.ts +37 -0
  193. package/src/i18n/locales/it.ts +41 -0
  194. package/src/i18n/locales/zh.ts +32 -0
  195. package/src/i18n/review.ts +19 -0
  196. package/src/index.ts +18 -0
  197. package/src/lib/column-mapping.ts +234 -0
  198. package/src/lib/strip-fade.ts +2 -2
  199. package/src/lib/table-text.ts +271 -0
  200. package/src/rhf/fields.tsx +421 -6
  201. package/src/rhf.ts +2 -1
  202. package/src/shell/topbar-action-menu.tsx +134 -38
  203. package/src/wizard/stepper-nav.tsx +35 -1
  204. package/dist/components/field-anatomy.d.ts +0 -95
  205. package/dist/components/field-anatomy.js +0 -84
  206. package/dist/components/field-anatomy.js.map +0 -1
  207. package/dist/feedback-attachment-NhUm7Zga.d.ts +0 -367
  208. package/src/components/field-anatomy.tsx +0 -190
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { ComponentPropsWithoutRef, ReactNode } from 'react';
2
+ import { ComponentPropsWithoutRef, ReactNode, Ref } from 'react';
3
3
  import { ComboClearValue, ComboOption } from './combobox-core.js';
4
4
  import '../hooks/use-anchored-rect.js';
5
5
  import '../hooks/use-anchored-panel.js';
@@ -42,6 +42,18 @@ interface ComboboxProps extends Omit<ComponentPropsWithoutRef<"div">, "id" | "on
42
42
  * stops toggling with it — it is a mouse target the input's own `disabled` does
43
43
  * not reach. */
44
44
  disabled?: boolean;
45
+ /**
46
+ * Why the value cannot be changed — {@link Button}'s `disabledReason`, for a field
47
+ * that SAVES itself (an inline editor whose blur writes). The input stays focusable
48
+ * and `aria-disabled`, is `readOnly`, opens no list and calls neither `onChange` nor
49
+ * `onSubmit`; the reason is in the kit {@link Tooltip} and on its `aria-describedby`.
50
+ * Wins over `disabled`. The family's lock (keksdose G2) — see {@link InlineEntityCombobox}.
51
+ */
52
+ disabledReason?: ReactNode;
53
+ /** This field COMMITS. Under a locked {@link WriteLockProvider} it is locked the
54
+ * `disabledReason` way with the lock's reason; inside a form with its own Save, leave
55
+ * it off and put `commit` on the Save. No provider, or an unlocked one: no effect. */
56
+ commit?: boolean;
45
57
  /** Heading an option belongs under. Supplying it makes this list read exactly
46
58
  * like {@link InlineEntityCombobox}'s — one heading per group with its rows
47
59
  * indented beneath — instead of a flat list (feedback #136 rework: the payee
@@ -78,6 +90,14 @@ interface ComboboxProps extends Omit<ComponentPropsWithoutRef<"div">, "id" | "on
78
90
  maxSuggestions?: number;
79
91
  searchPlaceholder?: string;
80
92
  closeLabel?: string;
93
+ /**
94
+ * The phone sheet's heading — and, as a string, the dialog's accessible name — for a
95
+ * field whose label is drawn by someone else: a form's `FormLabel` above it,
96
+ * which `RhfTextCombobox` hands over here (0.24). Default: `label`. Without either, the
97
+ * full-screen sheet opened untitled and unnamed, the one screen on a phone that has to
98
+ * say what it is asking for (live #200).
99
+ */
100
+ sheetTitle?: ReactNode;
81
101
  /**
82
102
  * Label for the row that COMMITS a value the list does not contain — e.g.
83
103
  * `(v) => \`Add "${v}" as payee\``. Supplying it turns the free text into
@@ -94,6 +114,15 @@ interface ComboboxProps extends Omit<ComponentPropsWithoutRef<"div">, "id" | "on
94
114
  * values are all supposed to already exist.
95
115
  */
96
116
  createLabel?: (value: string) => string;
117
+ /**
118
+ * The `<input>` — the control a reader types in and the one focus belongs on — as a
119
+ * React 19 ref prop, the way {@link CountrySelect} takes its trigger's (0.24, kastlan:
120
+ * react-hook-form's focus-on-error calls `focus()` on whatever `field.ref` is handed,
121
+ * and a combobox with no ref inside a hand-wired `RhfField` gave it nothing, so a
122
+ * failed submit could not take the user to it). Not the wrapper: a ref is for focus,
123
+ * measurement and selection, and all three are the input's. `RhfTextCombobox` passes it.
124
+ */
125
+ ref?: Ref<HTMLInputElement>;
97
126
  }
98
127
  /**
99
128
  * Free-text combobox that looks like the shared {@link Select} (same FIELD_BASE
@@ -105,7 +134,7 @@ interface ComboboxProps extends Omit<ComponentPropsWithoutRef<"div">, "id" | "on
105
134
  * visually and behaviourally consistent with the other dropdowns (feedback
106
135
  * #230 — the payee field looked/behaved differently from every other select).
107
136
  */
108
- declare function Combobox({ value, onChange, options, label, id, placeholder, className, groupBy, maxSuggestions, searchPlaceholder, closeLabel, createLabel, invalid, error, hint, disabled, optionAdornment, autoFocus, onBlur, onSubmit, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, ...rest }: ComboboxProps): react.JSX.Element;
137
+ declare function Combobox(props: ComboboxProps): react.JSX.Element;
109
138
  /** `id` is the INPUT's and `onChange` is the field's — see {@link ComboboxProps}
110
139
  * for why the div's spellings of them are omitted. */
111
140
  interface InlineEntityComboboxProps<V extends string | number, C extends ComboClearValue = null> extends Omit<ComponentPropsWithoutRef<"div">, "id" | "onChange"> {
@@ -142,6 +171,11 @@ interface InlineEntityComboboxProps<V extends string | number, C extends ComboCl
142
171
  * list simply does not open. Default: `combobox.noResults` from the provider. */
143
172
  emptyLabel?: string;
144
173
  closeLabel?: string;
174
+ /** The phone sheet's heading (and, as a string, its accessible name) for a field
175
+ * whose label is drawn by someone else — a form's `FormLabel`;
176
+ * `RhfInlineEntityCombobox` hands its label over here (0.24). Default: `label`.
177
+ * See {@link Combobox}'s `sheetTitle`. */
178
+ sheetTitle?: ReactNode;
145
179
  /** Offer a clear "×" in place of the chevron whenever something is selected.
146
180
  *
147
181
  * Emptying the text already clears (see {@link reconcile}), and on a desktop that
@@ -152,6 +186,82 @@ interface InlineEntityComboboxProps<V extends string | number, C extends ComboCl
152
186
  * affordance both shells share, and it clears without opening anything. */
153
187
  clearable?: boolean;
154
188
  clearLabel?: string;
189
+ /**
190
+ * Why the choice cannot be changed — {@link Button}'s `disabledReason`, for a picker
191
+ * that SAVES on change. keksdose G2: the statement review's account picker IS the
192
+ * write (picking re-runs the duplicate check on the server), and on the read-only demo
193
+ * the app wrapped it in a hand-made Tooltip over a native `disabled` — out of the tab
194
+ * order, so the reason never reached a keyboard.
195
+ *
196
+ * With a reason the input stays focusable and `aria-disabled`, is `readOnly` (the
197
+ * settled grey), opens no list or sheet, offers no clear "×", and no pick, typed
198
+ * label or clear reaches `onChange`; the reason is in the kit {@link Tooltip} and on
199
+ * the input's `aria-describedby`. Wins over `disabled`. Use it CONTROLLED, as the
200
+ * component always is: the shown label is `value`'s.
201
+ */
202
+ disabledReason?: ReactNode;
203
+ /**
204
+ * This picker COMMITS — choosing saves. Under a locked {@link WriteLockProvider} it is
205
+ * locked the `disabledReason` way with the lock's reason (which wins over its own).
206
+ * A picker inside a form with its own Save stays editable under the lock — leave this
207
+ * off there and put `commit` on the Save. No provider, or an unlocked one: no effect.
208
+ */
209
+ commit?: boolean;
210
+ /**
211
+ * A last row that makes a new record from what was typed — keksdose G9, whose "Create
212
+ * cash account" had to become a separate button because this picker had no such row.
213
+ *
214
+ * Shown while the typed query is non-empty and names no option exactly
215
+ * (case-insensitive — an exact hit is a record the list already shows), worded
216
+ * `createLabel(query)`, default `combobox.create`: "Create “{query}”". The arrow keys
217
+ * reach it like an option; Enter or a click calls `onCreate(query)` and closes the
218
+ * list. Making the record, and then passing its id as `value`, is the caller's: the
219
+ * field shows the old selection until it does.
220
+ *
221
+ * The same rule as {@link EntityCombobox}'s `onCreate`, so the family agrees. It is a
222
+ * row of the LIST, not an option: it is never `aria-selected`, never matched by a
223
+ * typed label on blur, and never sorted among the records the way a sentinel option
224
+ * would be (the reason keksdose gave for the separate button).
225
+ */
226
+ onCreate?: (query: string) => void;
227
+ /** The create row's words for a query. Default: `combobox.create` from the
228
+ * {@link UiKitProvider}, else English `Create “{query}”`. */
229
+ createLabel?: (query: string) => string;
230
+ /**
231
+ * Offer the create row with NOTHING typed too, worded as this — keksdose's "Create cash
232
+ * account", which mints an account under a default name and so needs no query.
233
+ * `onCreate` then receives `""`, and the caller supplies the name. Left out, the row
234
+ * needs a query.
235
+ *
236
+ * One string rather than a switch: a row with no query has nothing to quote, so the
237
+ * kit cannot word it — "Create “”" says nothing — and naming it is what turns it on.
238
+ * With both, one handler serves both rows:
239
+ *
240
+ * ```tsx
241
+ * onCreate={(name) => createCash(name || t("cash_account_default_name"))}
242
+ * createEmptyLabel={t("create_cash_account")}
243
+ * ```
244
+ */
245
+ createEmptyLabel?: string;
246
+ /**
247
+ * The create row WRITES while picking does not — keksdose dev#496: on the read-only
248
+ * demo choosing the cash account is draft state and stays live, minting one is a
249
+ * write. Under a locked {@link WriteLockProvider} the row stays in the list, dimmed and
250
+ * passed over by the arrows, with the lock's reason as its second line (a hover is the
251
+ * one explanation a phone cannot show), and `onCreate` is not called. Not needed with
252
+ * `commit`: a locked field opens no list at all.
253
+ */
254
+ createCommit?: boolean;
255
+ /**
256
+ * The `<input>` — the focusable control, the one a reader types in — as a React 19
257
+ * ref prop (0.24, kastlan). Its account picker is this component inside an
258
+ * `RhfField` render, and react-hook-form's focus-on-error calls `focus()` on whatever
259
+ * `field.ref` is handed: with no ref there was nothing to hand it, so a line-item form
260
+ * whose account was missing failed its submit and left the caret where it was. Pass
261
+ * `field.ref` here, or use `RhfInlineEntityCombobox`, which does. The wrapper is not
262
+ * reachable this way — focus and selection are the input's. See {@link Combobox}'s `ref`.
263
+ */
264
+ ref?: Ref<HTMLInputElement>;
155
265
  }
156
266
  /**
157
267
  * The id-keyed sibling of {@link Combobox}: identical anatomy (a real text input
@@ -171,6 +281,6 @@ interface InlineEntityComboboxProps<V extends string | number, C extends ComboCl
171
281
  * sheet that emptied it to show the full list would read as "the user cleared the
172
282
  * field" the moment it closed.
173
283
  */
174
- declare function InlineEntityCombobox<V extends string | number, C extends ComboClearValue = null>({ value: rawValue, onChange, clearValue, options, label, id, placeholder, className, disabled, autoFocus, searchPlaceholder, emptyLabel, closeLabel, clearable, clearLabel, invalid, error, hint, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, ...rest }: InlineEntityComboboxProps<V, C>): react.JSX.Element;
284
+ declare function InlineEntityCombobox<V extends string | number, C extends ComboClearValue = null>(props: InlineEntityComboboxProps<V, C>): react.JSX.Element;
175
285
 
176
286
  export { Combobox, type ComboboxProps, InlineEntityCombobox, type InlineEntityComboboxProps };