@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.
- package/README.md +42 -25
- package/dist/chart.d.ts +8 -7
- package/dist/components/amount-input.d.ts +34 -7
- package/dist/components/amount-input.js +14 -10
- package/dist/components/amount-input.js.map +1 -1
- package/dist/components/autocomplete.d.ts +26 -0
- package/dist/components/autocomplete.js +164 -137
- package/dist/components/autocomplete.js.map +1 -1
- package/dist/components/button-group.d.ts +8 -7
- package/dist/components/calculator.d.ts +8 -7
- package/dist/components/column-mapper.d.ts +235 -0
- package/dist/components/column-mapper.js +411 -0
- package/dist/components/column-mapper.js.map +1 -0
- package/dist/components/combobox-core.d.ts +39 -2
- package/dist/components/combobox-core.js +29 -6
- package/dist/components/combobox-core.js.map +1 -1
- package/dist/components/combobox.d.ts +113 -3
- package/dist/components/combobox.js +456 -313
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/confirm-dialog.d.ts +8 -7
- package/dist/components/confirm-dialog.js +7 -8
- package/dist/components/confirm-dialog.js.map +1 -1
- package/dist/components/copy-button.d.ts +5 -4
- package/dist/components/country-select.d.ts +50 -7
- package/dist/components/country-select.js +65 -9
- package/dist/components/country-select.js.map +1 -1
- package/dist/components/danger-confirm.d.ts +8 -7
- package/dist/components/danger-confirm.js +64 -7
- package/dist/components/danger-confirm.js.map +1 -1
- package/dist/components/date-picker.d.ts +41 -0
- package/dist/components/date-picker.js +269 -8
- package/dist/components/date-picker.js.map +1 -1
- package/dist/components/entity-combobox.d.ts +48 -2
- package/dist/components/entity-combobox.js +159 -114
- package/dist/components/entity-combobox.js.map +1 -1
- package/dist/components/facing-pair.d.ts +8 -7
- package/dist/components/field-parts.d.ts +116 -6
- package/dist/components/field-parts.js +84 -0
- package/dist/components/field-parts.js.map +1 -1
- package/dist/components/field-strip.d.ts +105 -0
- package/dist/components/field-strip.js +46 -0
- package/dist/components/field-strip.js.map +1 -0
- package/dist/components/file-button.d.ts +8 -7
- package/dist/components/file-dropzone.d.ts +8 -7
- package/dist/components/form-actions.d.ts +8 -7
- package/dist/components/form-actions.js +23 -3
- package/dist/components/form-actions.js.map +1 -1
- package/dist/components/iban-input.d.ts +8 -7
- package/dist/components/icon-picker.d.ts +10 -1
- package/dist/components/icon-picker.js +12 -4
- package/dist/components/icon-picker.js.map +1 -1
- package/dist/components/language-select.d.ts +8 -7
- package/dist/components/money-field.d.ts +11 -7
- package/dist/components/money-field.js.map +1 -1
- package/dist/components/month-picker.js +2 -1
- package/dist/components/month-picker.js.map +1 -1
- package/dist/components/multi-entity-combobox.d.ts +31 -2
- package/dist/components/multi-entity-combobox.js +152 -103
- package/dist/components/multi-entity-combobox.js.map +1 -1
- package/dist/components/number-field.d.ts +8 -7
- package/dist/components/number-input.d.ts +8 -7
- package/dist/components/numpad-sheet.d.ts +8 -7
- package/dist/components/phone-input.d.ts +8 -7
- package/dist/components/reauth-dialog.d.ts +2 -2
- package/dist/components/reauth-dialog.js +6 -8
- package/dist/components/reauth-dialog.js.map +1 -1
- package/dist/components/series-chart.d.ts +8 -7
- package/dist/components/settings-fields.d.ts +8 -7
- package/dist/components/share-card.d.ts +8 -7
- package/dist/components/swatch-picker.d.ts +17 -1
- package/dist/components/swatch-picker.js +10 -4
- package/dist/components/swatch-picker.js.map +1 -1
- package/dist/components/text-link.d.ts +8 -7
- package/dist/components/tile-radio.d.ts +20 -0
- package/dist/components/tile-radio.js +25 -8
- package/dist/components/tile-radio.js.map +1 -1
- package/dist/components/time-input.d.ts +8 -7
- package/dist/components/toggle-group.js +2 -2
- package/dist/components/toggle-group.js.map +1 -1
- package/dist/components/trigger-aria.d.ts +3 -0
- package/dist/components/trigger-aria.js +3 -1
- package/dist/components/trigger-aria.js.map +1 -1
- package/dist/components/ui.d.ts +5 -4
- package/dist/components/ui.js +60 -28
- package/dist/components/ui.js.map +1 -1
- package/dist/feedback/feedback-attachment.d.ts +66 -1
- package/dist/feedback/feedback-attachment.js +185 -65
- package/dist/feedback/feedback-attachment.js.map +1 -1
- package/dist/feedback/feedback-dialog.d.ts +66 -1
- package/dist/feedback/feedback-dialog.js.map +1 -1
- package/dist/feedback/feedback-inbox.d.ts +67 -252
- package/dist/feedback/feedback-inbox.js.map +1 -1
- package/dist/feedback/feedback-thread.d.ts +66 -287
- package/dist/feedback/feedback-thread.js +16 -3
- package/dist/feedback/feedback-thread.js.map +1 -1
- package/dist/{kit-labels-R8mIAc9N.d.ts → feedback-DOwPu-Il.d.ts} +1273 -30
- package/dist/feedback.d.ts +65 -3
- package/dist/hooks/use-file-drop.d.ts +8 -7
- package/dist/i18n/defaults.d.ts +8 -7
- package/dist/i18n/defaults.js +3 -1
- package/dist/i18n/defaults.js.map +1 -1
- package/dist/i18n/german.d.ts +8 -7
- package/dist/i18n/german.js +36 -2
- package/dist/i18n/german.js.map +1 -1
- package/dist/i18n/kit-labels.d.ts +5 -4
- package/dist/i18n/kit-labels.js.map +1 -1
- package/dist/i18n/languages.d.ts +8 -7
- package/dist/i18n/locales/de-CH.d.ts +8 -7
- package/dist/i18n/locales/en.d.ts +8 -7
- package/dist/i18n/locales/en.js +7 -0
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +8 -7
- package/dist/i18n/locales/es.js +37 -2
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +8 -7
- package/dist/i18n/locales/fr.js +36 -2
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hu.d.ts +8 -7
- package/dist/i18n/locales/hu.js +38 -2
- package/dist/i18n/locales/hu.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +8 -7
- package/dist/i18n/locales/it.js +37 -2
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +8 -7
- package/dist/i18n/locales/zh.js +34 -2
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/i18n/review.d.ts +8 -7
- package/dist/i18n/review.js +20 -1
- package/dist/i18n/review.js.map +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/column-mapping.d.ts +81 -0
- package/dist/lib/column-mapping.js +108 -0
- package/dist/lib/column-mapping.js.map +1 -0
- package/dist/lib/strip-fade.d.ts +2 -2
- package/dist/lib/strip-fade.js.map +1 -1
- package/dist/lib/table-text.d.ts +109 -1
- package/dist/lib/table-text.js +122 -1
- package/dist/lib/table-text.js.map +1 -1
- package/dist/rhf/fields.d.ts +142 -13
- package/dist/rhf/fields.js +185 -3
- package/dist/rhf/fields.js.map +1 -1
- package/dist/rhf/form.d.ts +8 -7
- package/dist/rhf.d.ts +9 -8
- package/dist/rhf.js.map +1 -1
- package/dist/shell/app-shell.d.ts +8 -7
- package/dist/shell/top-bar-brand.d.ts +8 -7
- package/dist/shell/topbar-action-menu.d.ts +36 -3
- package/dist/shell/topbar-action-menu.js +74 -33
- package/dist/shell/topbar-action-menu.js.map +1 -1
- package/dist/shell.d.ts +8 -7
- package/dist/table-text.d.ts +1 -1
- package/dist/wizard/stepper-nav.d.ts +38 -9
- package/dist/wizard/stepper-nav.js +4 -0
- package/dist/wizard/stepper-nav.js.map +1 -1
- package/dist/wizard.d.ts +8 -7
- package/package.json +1 -1
- package/src/components/amount-input.tsx +50 -14
- package/src/components/autocomplete.tsx +188 -116
- package/src/components/column-mapper.tsx +768 -0
- package/src/components/combobox-core.tsx +82 -9
- package/src/components/combobox.tsx +655 -335
- package/src/components/confirm-dialog.tsx +12 -8
- package/src/components/country-select.tsx +135 -22
- package/src/components/danger-confirm.tsx +274 -24
- package/src/components/date-picker.tsx +423 -10
- package/src/components/entity-combobox.tsx +243 -129
- package/src/components/field-parts.tsx +224 -5
- package/src/components/field-strip.tsx +149 -0
- package/src/components/form-actions.tsx +52 -5
- package/src/components/icon-picker.tsx +23 -4
- package/src/components/money-field.tsx +3 -0
- package/src/components/month-picker.tsx +2 -1
- package/src/components/multi-entity-combobox.tsx +221 -121
- package/src/components/reauth-dialog.tsx +17 -18
- package/src/components/swatch-picker.tsx +29 -5
- package/src/components/tile-radio.tsx +74 -13
- package/src/components/toggle-group.tsx +2 -2
- package/src/components/trigger-aria.ts +5 -0
- package/src/components/ui.tsx +114 -33
- package/src/feedback/feedback-attachment.tsx +372 -72
- package/src/feedback/feedback-dialog.tsx +7 -3
- package/src/feedback/feedback-inbox.tsx +3 -2
- package/src/feedback/feedback-thread.tsx +112 -9
- package/src/i18n/defaults.ts +2 -0
- package/src/i18n/german.ts +42 -0
- package/src/i18n/kit-labels.tsx +4 -0
- package/src/i18n/locales/en.ts +27 -5
- package/src/i18n/locales/es.ts +41 -0
- package/src/i18n/locales/fr.ts +42 -0
- package/src/i18n/locales/hu.ts +37 -0
- package/src/i18n/locales/it.ts +41 -0
- package/src/i18n/locales/zh.ts +32 -0
- package/src/i18n/review.ts +19 -0
- package/src/index.ts +18 -0
- package/src/lib/column-mapping.ts +234 -0
- package/src/lib/strip-fade.ts +2 -2
- package/src/lib/table-text.ts +271 -0
- package/src/rhf/fields.tsx +421 -6
- package/src/rhf.ts +2 -1
- package/src/shell/topbar-action-menu.tsx +134 -38
- package/src/wizard/stepper-nav.tsx +35 -1
- package/dist/components/field-anatomy.d.ts +0 -95
- package/dist/components/field-anatomy.js +0 -84
- package/dist/components/field-anatomy.js.map +0 -1
- package/dist/feedback-attachment-NhUm7Zga.d.ts +0 -367
- package/src/components/field-anatomy.tsx +0 -190
|
@@ -1,288 +1,67 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import 'react';
|
|
2
|
+
export { z as ChatComposer, D as ChatComposerHandle, E as ChatComposerLabels, F as ChatComposerProps, G as ChatComposerSlotContext, a6 as DEFAULT_FEEDBACK_COMPOSER_LABELS, a8 as DEFAULT_FEEDBACK_THREAD_LABELS, aV as FeedbackComposer, aW as FeedbackComposerAttachment, aX as FeedbackComposerHandle, aY as FeedbackComposerLabels, aZ as FeedbackComposerProps, a_ as FeedbackComposerSlotContext, bf as FeedbackThread, bg as FeedbackThreadAttachment, bh as FeedbackThreadEvent, bi as FeedbackThreadItem, bj as FeedbackThreadLabels, bk as FeedbackThreadMessage, bl as FeedbackThreadProps } from '../feedback-DOwPu-Il.js';
|
|
3
|
+
import '../components/tooltip.js';
|
|
4
|
+
import '../hooks/use-anchored-rect.js';
|
|
5
|
+
import '../lib/clipping.js';
|
|
6
|
+
import '../data-table-labels-B7OdnM0S.js';
|
|
7
|
+
import '../components/data-table-sort.js';
|
|
8
|
+
import '../components/swipeable-row.js';
|
|
9
|
+
import '../components/mini-calendar.js';
|
|
10
|
+
import '../components/calendar-heatmap.js';
|
|
11
|
+
import '../components/popover.js';
|
|
12
|
+
import '../components/chip.js';
|
|
5
13
|
import 'lucide-react';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
/** The shortcut line, given the platform's modifier ("Ctrl" or "⌘"). */
|
|
61
|
-
sendHint: (modifier: string) => string;
|
|
62
|
-
/** The shortcut line under `sendOn="enter"` (keksdose G5): Enter sends, so say how a
|
|
63
|
-
* new line is made. */
|
|
64
|
-
sendHintEnter: string;
|
|
65
|
-
}
|
|
66
|
-
declare const DEFAULT_FEEDBACK_COMPOSER_LABELS: FeedbackComposerLabels;
|
|
67
|
-
interface FeedbackThreadAttachment {
|
|
68
|
-
id?: string | number;
|
|
69
|
-
name: string;
|
|
70
|
-
/** Where to open it. Left out, the attachment is listed by name only. */
|
|
71
|
-
url?: string;
|
|
72
|
-
/** MIME type; an `image/*` with a `url` is shown as a thumbnail. */
|
|
73
|
-
type?: string;
|
|
74
|
-
/** Bytes, shown beside a non-image. */
|
|
75
|
-
size?: number;
|
|
76
|
-
}
|
|
77
|
-
interface FeedbackThreadMessage {
|
|
78
|
-
/** Leave out, or `"message"`. `"event"` is a {@link FeedbackThreadEvent}. */
|
|
79
|
-
kind?: "message";
|
|
80
|
-
id: string | number;
|
|
81
|
-
/** Who wrote it. Left out on an `own` message, it reads "You". */
|
|
82
|
-
author?: ReactNode;
|
|
83
|
-
/** A `Date`, an ISO string or epoch ms. */
|
|
84
|
-
createdAt: Date | string | number;
|
|
85
|
-
body: string;
|
|
86
|
-
attachments?: readonly FeedbackThreadAttachment[];
|
|
87
|
-
/** Written by whoever is reading: sits at the end side, in the brand tint. */
|
|
88
|
-
own?: boolean;
|
|
89
|
-
/** Written by the team rather than a user: gets the "Staff" badge. */
|
|
90
|
-
staff?: boolean;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* A line in the thread that nobody wrote — "Closed automatically", "Marked as
|
|
94
|
-
* resolved", "Reopened" — drawn centred and muted with its time, no author, no side,
|
|
95
|
-
* no bubble.
|
|
96
|
-
*
|
|
97
|
-
* keksdose G4: its support chat interleaves these with the messages, and as a message
|
|
98
|
-
* they came out as a bubble from nobody at the start side, which reads as the member
|
|
99
|
-
* having said "resolved". Word it for the READER, as with `own`: the app knows whether
|
|
100
|
-
* "you reopened it" or "Anna reopened it" is true for the person looking.
|
|
101
|
-
*
|
|
102
|
-
* The text is the app's, not somebody's words about their data, so it is NOT tagged
|
|
103
|
-
* `data-private`; one that names a person can wrap the name in its own
|
|
104
|
-
* `<span data-private>` (`body` is a node for that reason).
|
|
105
|
-
*/
|
|
106
|
-
interface FeedbackThreadEvent {
|
|
107
|
-
kind: "event";
|
|
108
|
-
id: string | number;
|
|
109
|
-
/** A `Date`, an ISO string or epoch ms. */
|
|
110
|
-
createdAt: Date | string | number;
|
|
111
|
-
body: ReactNode;
|
|
112
|
-
}
|
|
113
|
-
/** One row of a {@link FeedbackThread}: a message, or an event line between them. */
|
|
114
|
-
type FeedbackThreadItem = FeedbackThreadMessage | FeedbackThreadEvent;
|
|
115
|
-
interface FeedbackThreadProps {
|
|
116
|
-
/** Oldest first. Event lines ({@link FeedbackThreadEvent}) sit among the messages. */
|
|
117
|
-
messages: readonly FeedbackThreadItem[];
|
|
118
|
-
loading?: boolean;
|
|
119
|
-
/** Replaces the default "No comments yet". */
|
|
120
|
-
empty?: ReactNode;
|
|
121
|
-
/**
|
|
122
|
-
* Draw one attachment yourself — for files behind auth, which a plain `<img src>`
|
|
123
|
-
* cannot fetch (kastlan's `AuthedImage`), or a lightbox. The default is a thumbnail
|
|
124
|
-
* link for an image with a `url`, a file link otherwise.
|
|
125
|
-
*/
|
|
126
|
-
renderAttachment?: (attachment: FeedbackThreadAttachment, message: FeedbackThreadMessage) => ReactNode;
|
|
127
|
-
/** Tag bodies, authors and attachments `data-private`. Default true. */
|
|
128
|
-
redact?: boolean;
|
|
129
|
-
/**
|
|
130
|
-
* How a row's time reads. `"relative"` (default): "5 minutes ago", a date past six
|
|
131
|
-
* days — right for a report's comments, read days apart. `"clock"`: the time of day
|
|
132
|
-
* in the locale ("14:05", "2:05 PM") — the chat look, keksdose G4; pair it with
|
|
133
|
-
* `daySeparators`, which say which day that clock time is on. Either way the full
|
|
134
|
-
* date and time is in the Tooltip.
|
|
135
|
-
*/
|
|
136
|
-
timeFormat?: "relative" | "clock";
|
|
137
|
-
/**
|
|
138
|
-
* A centred day line before the first row and wherever the next row is on another
|
|
139
|
-
* calendar day (the device's zone): "Today", "Yesterday", else the date — keksdose
|
|
140
|
-
* G4. "Today" / "Yesterday" are `Intl.RelativeTimeFormat`'s own words in the kit
|
|
141
|
-
* locale, so there is no label to translate. Default false.
|
|
142
|
-
*/
|
|
143
|
-
daySeparators?: boolean;
|
|
144
|
-
/** "Now" for the relative times and the day lines — pin it in tests and stories.
|
|
145
|
-
* Default: the clock. */
|
|
146
|
-
now?: Date | number;
|
|
147
|
-
/** Overrides the provider's locale for the times. */
|
|
148
|
-
locale?: string;
|
|
149
|
-
labels?: Partial<FeedbackThreadLabels>;
|
|
150
|
-
className?: string;
|
|
151
|
-
}
|
|
152
|
-
declare function FeedbackThread({ messages, loading, empty, renderAttachment, redact, now, locale: localeProp, timeFormat, daySeparators, labels: labelsProp, className, }: FeedbackThreadProps): react.JSX.Element;
|
|
153
|
-
/** What the composer's attach control takes — {@link FeedbackNoteAttachment} with the
|
|
154
|
-
* labels optional, since the field reads `feedbackAttachment` from the provider. */
|
|
155
|
-
type FeedbackComposerAttachment = Omit<FeedbackNoteAttachment, "labels"> & {
|
|
156
|
-
labels?: Partial<FeedbackAttachmentLabels>;
|
|
157
|
-
};
|
|
158
|
-
interface FeedbackComposerProps {
|
|
159
|
-
/**
|
|
160
|
-
* Send the comment. Return the promise: the box clears when it RESOLVES, and only of
|
|
161
|
-
* what was sent — text typed while it was in flight stays. A rejection keeps
|
|
162
|
-
* everything for a retry (surface the error yourself; the composer stays quiet).
|
|
163
|
-
*
|
|
164
|
-
* `attachment` is the built-in field's one picture. Files the host uploaded ahead
|
|
165
|
-
* (`attachmentSlot`) are the host's state, read by the host here — and `body` may be
|
|
166
|
-
* `""` when `canSend` let an attachments-only message go.
|
|
167
|
-
*/
|
|
168
|
-
onSend: (body: string, attachment: File | null) => void | Promise<unknown>;
|
|
169
|
-
/** The send is in flight: a spinner on the button and no second send. */
|
|
170
|
-
pending?: boolean;
|
|
171
|
-
/** Offer one picture with the comment (file, paste or `onCaptureScreenshot`).
|
|
172
|
-
* `true` for the defaults. Left out, the composer is text only. */
|
|
173
|
-
attachment?: boolean | FeedbackComposerAttachment;
|
|
174
|
-
/**
|
|
175
|
-
* The host's own attach control, in the row with Send where the built-in field sits
|
|
176
|
-
* (after it, if both are on) — keksdose G5: its support chat uploads up to N files
|
|
177
|
-
* AHEAD of the send and sends their refs, which one `File` in `onSend` cannot carry.
|
|
178
|
-
* The slot is the host's picker plus the chips of what is uploaded; the upload, the
|
|
179
|
-
* refs and clearing them once `onSend` resolves stay with the host. Pair it with
|
|
180
|
-
* `canSend`.
|
|
181
|
-
*/
|
|
182
|
-
attachmentSlot?: ReactNode;
|
|
183
|
-
/**
|
|
184
|
-
* Whether Send is enabled, over the composer's own rule (some text in the box) —
|
|
185
|
-
* for state the composer cannot see, i.e. `attachmentSlot`'s (keksdose G5): `true`
|
|
186
|
-
* with files ready makes an empty draft sendable (`onSend("", null)`), `false` while
|
|
187
|
-
* an upload is still running holds even a written reply back. Left out, the text
|
|
188
|
-
* decides. `pending` blocks a send either way.
|
|
189
|
-
*/
|
|
190
|
-
canSend?: boolean;
|
|
191
|
-
/**
|
|
192
|
-
* Which key sends. `"mod-enter"` (default): Ctrl/⌘+Enter, the report dialog's and
|
|
193
|
-
* note editor's shortcut, with plain Enter a new line — feedback is written in
|
|
194
|
-
* paragraphs. `"enter"`: the chat way (keksdose G5) — Enter sends, Shift+Enter is a
|
|
195
|
-
* new line, Ctrl/⌘+Enter still sends; an Enter that confirms an IME composition
|
|
196
|
-
* (Japanese, Chinese input) is the IME's, never a send.
|
|
197
|
-
*/
|
|
198
|
-
sendOn?: "mod-enter" | "enter";
|
|
199
|
-
/** Rendered INSTEAD of the composer — the thread is closed, or read-only for this
|
|
200
|
-
* reader. */
|
|
201
|
-
disabledReason?: ReactNode;
|
|
202
|
-
rows?: number;
|
|
203
|
-
/**
|
|
204
|
-
* The box's hint, over the `placeholder` label — keksdose F9: an admin answering a
|
|
205
|
-
* support ticket is asked something else ("Reply to Anna…") than a member adding to
|
|
206
|
-
* their own report, and one provider-wide label cannot say both.
|
|
207
|
-
*/
|
|
208
|
-
placeholder?: string;
|
|
209
|
-
/**
|
|
210
|
-
* The draft, controlled — for a host that keeps it itself (saves it per ticket,
|
|
211
|
-
* prefills a template). Left out, the composer keeps its own. Either way a send
|
|
212
|
-
* that resolves clears only what was sent: controlled, that is an
|
|
213
|
-
* `onValueChange("")` the host receives like any keystroke, and only if the draft
|
|
214
|
-
* is still the one that went out.
|
|
215
|
-
*/
|
|
216
|
-
value?: string;
|
|
217
|
-
/** Every change to the draft — typing, {@link FeedbackComposerHandle.insertText}, the
|
|
218
|
-
* clear after a send. Required to change a controlled `value`. */
|
|
219
|
-
onValueChange?: (value: string) => void;
|
|
220
|
-
/** {@link FeedbackComposerHandle}: put text into the draft from outside (canned-reply
|
|
221
|
-
* chips) or focus the box. */
|
|
222
|
-
ref?: Ref<FeedbackComposerHandle>;
|
|
223
|
-
labels?: Partial<FeedbackComposerLabels>;
|
|
224
|
-
className?: string;
|
|
225
|
-
/**
|
|
226
|
-
* `"sm"` for a narrow host — keksdose's assistant launcher, a small floating panel
|
|
227
|
-
* (0.22): a small Send button, and the send hint ("Enter to send, Shift + Enter for a
|
|
228
|
-
* new line") hidden from view but kept as the box's description, so a keyboard or
|
|
229
|
-
* screen-reader user still learns the shortcut. Default `"md"`.
|
|
230
|
-
*/
|
|
231
|
-
size?: "md" | "sm";
|
|
232
|
-
/**
|
|
233
|
-
* On the composer's root — the box, or the `disabledReason` line in its place —
|
|
234
|
-
* with any `data-*` attribute beside it (keksdose K17). keksdose's assistant tour
|
|
235
|
-
* points at the chat box with `[data-tour="assistant-ask"]`, and a composer that
|
|
236
|
-
* dropped every attribute it was not told about left the anchor nowhere: the
|
|
237
|
-
* assistant kept its hand-built box rather than lose the tour step.
|
|
238
|
-
*/
|
|
239
|
-
id?: string;
|
|
240
|
-
/** `data-*` attributes for the root, as `id` — a tour anchor, a test id. */
|
|
241
|
-
[dataAttribute: `data-${string}`]: string | number | boolean | undefined;
|
|
242
|
-
}
|
|
243
|
-
/**
|
|
244
|
-
* What a {@link FeedbackComposer} `ref` holds.
|
|
245
|
-
*
|
|
246
|
-
* keksdose F9: the support admin answers the same five questions all day and wants
|
|
247
|
-
* chips above the box ("Thanks, fixed in the next release") that drop their text in
|
|
248
|
-
* where the caret is. A controlled `value` alone cannot do that well — the host sees
|
|
249
|
-
* the string, not the caret, so it could only append — so the composer, which owns
|
|
250
|
-
* the textarea, does the splice.
|
|
251
|
-
*/
|
|
252
|
-
interface FeedbackComposerHandle {
|
|
253
|
-
/**
|
|
254
|
-
* Insert `text` at the caret, replacing any selection (the caret the box last had:
|
|
255
|
-
* a click on a chip blurs it, and the selection survives the blur), then focus the
|
|
256
|
-
* box with the caret after the inserted text so the reply can go on. Nothing is
|
|
257
|
-
* added around it — put a space or a newline in `text` if the reply needs one. A
|
|
258
|
-
* no-op while `disabledReason` replaces the box.
|
|
259
|
-
*/
|
|
260
|
-
insertText: (text: string) => void;
|
|
261
|
-
focus: () => void;
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* The answer box under a {@link FeedbackThread}: a textarea, an optional picture,
|
|
265
|
-
* and Send — Ctrl/⌘+Enter sends, the shortcut the report dialog and the note editor
|
|
266
|
-
* use, so the habit carries across the feature. Plain Enter is a new line: feedback is
|
|
267
|
-
* written in paragraphs, unlike a chat — which `sendOn="enter"` is for (keksdose G5).
|
|
268
|
-
*/
|
|
269
|
-
declare function FeedbackComposer({ onSend, pending, attachment, attachmentSlot, canSend: canSendProp, sendOn, disabledReason, rows, placeholder, value, onValueChange, ref, labels: labelsProp, className, id, size, ...rest }: FeedbackComposerProps): react.JSX.Element;
|
|
270
|
-
/**
|
|
271
|
-
* {@link FeedbackComposer} under a name that is not about feedback (keksdose K17).
|
|
272
|
-
*
|
|
273
|
-
* The component was never feedback-specific: a textarea, an optional picture or a
|
|
274
|
-
* host's upload slot, Send, `sendOn="enter"` for the chat way. keksdose's assistant
|
|
275
|
-
* and support chat are chats, not reports, and an import of `FeedbackComposer` there
|
|
276
|
-
* reads as a mistake to the next person. The same function, not a wrapper, so the
|
|
277
|
-
* two names cannot drift.
|
|
278
|
-
*/
|
|
279
|
-
declare const ChatComposer: typeof FeedbackComposer;
|
|
280
|
-
/** {@link FeedbackComposerProps}, for {@link ChatComposer}. */
|
|
281
|
-
type ChatComposerProps = FeedbackComposerProps;
|
|
282
|
-
/** {@link FeedbackComposerHandle}, for {@link ChatComposer}. */
|
|
283
|
-
type ChatComposerHandle = FeedbackComposerHandle;
|
|
284
|
-
/** {@link FeedbackComposerLabels}, for {@link ChatComposer} — still the `feedbackComposer`
|
|
285
|
-
* namespace of the provider. */
|
|
286
|
-
type ChatComposerLabels = FeedbackComposerLabels;
|
|
287
|
-
|
|
288
|
-
export { ChatComposer, type ChatComposerHandle, type ChatComposerLabels, type ChatComposerProps, DEFAULT_FEEDBACK_COMPOSER_LABELS, DEFAULT_FEEDBACK_THREAD_LABELS, FeedbackComposer, type FeedbackComposerAttachment, type FeedbackComposerHandle, type FeedbackComposerLabels, type FeedbackComposerProps, FeedbackThread, type FeedbackThreadAttachment, type FeedbackThreadEvent, type FeedbackThreadItem, type FeedbackThreadLabels, type FeedbackThreadMessage, type FeedbackThreadProps };
|
|
14
|
+
import '../components/field-sync.js';
|
|
15
|
+
import '../wizard/types.js';
|
|
16
|
+
import '../tour/tour.js';
|
|
17
|
+
import '../search/command-palette.js';
|
|
18
|
+
import '../search/global-search.js';
|
|
19
|
+
import '../search/search-index.js';
|
|
20
|
+
import '../components/month-picker.js';
|
|
21
|
+
import '../components/page-contents.js';
|
|
22
|
+
import '../components/series-chart-labels.js';
|
|
23
|
+
import '../components/pie-chart-labels.js';
|
|
24
|
+
import '../components/sparkline.js';
|
|
25
|
+
import '../components/stat-tile.js';
|
|
26
|
+
import '../components/signature-pad.js';
|
|
27
|
+
import '../components/password-strength.js';
|
|
28
|
+
import '../components/swatch-picker.js';
|
|
29
|
+
import '../components/tile-radio.js';
|
|
30
|
+
import '../components/icon-picker.js';
|
|
31
|
+
import '../components/dialog-frame.js';
|
|
32
|
+
import '../components/modal.js';
|
|
33
|
+
import '../hooks/use-search-param-state.js';
|
|
34
|
+
import '../components/measured-grid.js';
|
|
35
|
+
import '../components/account-settings-labels.js';
|
|
36
|
+
import '../components/floating-panel.js';
|
|
37
|
+
import '../components/bulk-action-bar.js';
|
|
38
|
+
import '../components/list.js';
|
|
39
|
+
import '../components/signed-amount.js';
|
|
40
|
+
import '../components/breadcrumbs.js';
|
|
41
|
+
import '../components/toast.js';
|
|
42
|
+
import '../components/description-list.js';
|
|
43
|
+
import '../components/line-items.js';
|
|
44
|
+
import '../components/progress-bar.js';
|
|
45
|
+
import '../components/error-boundary.js';
|
|
46
|
+
import '../components/authed-image.js';
|
|
47
|
+
import '../hooks/use-authed-src.js';
|
|
48
|
+
import '../components/image-grid.js';
|
|
49
|
+
import '../components/lightbox.js';
|
|
50
|
+
import '../components/write-lock.js';
|
|
51
|
+
import '../components/legal.js';
|
|
52
|
+
import '../components/account-chips.js';
|
|
53
|
+
import '../lib/format.js';
|
|
54
|
+
import '../components/reauth-dialog.js';
|
|
55
|
+
import '../components/server-wake.js';
|
|
56
|
+
import '../lib/server-wake.js';
|
|
57
|
+
import '../components/translation-review-labels.js';
|
|
58
|
+
import '../lib/translation-review.js';
|
|
59
|
+
import '../components/country-select.js';
|
|
60
|
+
import '../components/inline-edit-field.js';
|
|
61
|
+
import '../lib/iban.js';
|
|
62
|
+
import '../lib/phone.js';
|
|
63
|
+
import '../components/sign-chip.js';
|
|
64
|
+
import '../components/column-mapper.js';
|
|
65
|
+
import '../lib/column-mapping.js';
|
|
66
|
+
import '../lib/table-text.js';
|
|
67
|
+
import '../components/field-parts.js';
|
|
@@ -237,6 +237,9 @@ function FeedbackComposer({
|
|
|
237
237
|
sendOn = "mod-enter",
|
|
238
238
|
disabledReason,
|
|
239
239
|
rows = 3,
|
|
240
|
+
maxLength,
|
|
241
|
+
showCount,
|
|
242
|
+
countLabels,
|
|
240
243
|
placeholder,
|
|
241
244
|
value,
|
|
242
245
|
onValueChange,
|
|
@@ -294,7 +297,8 @@ function FeedbackComposer({
|
|
|
294
297
|
if (disabledReason != null && disabledReason !== false) {
|
|
295
298
|
return /* @__PURE__ */ jsx("p", { ...rootAttributes, className: cn("text-xs text-[var(--text-muted)]", className), children: disabledReason });
|
|
296
299
|
}
|
|
297
|
-
const
|
|
300
|
+
const tooLong = maxLength !== void 0 && draft.length > maxLength;
|
|
301
|
+
const canSend = (canSendProp ?? draft.trim().length > 0) && !pending && !tooLong;
|
|
298
302
|
const send = () => {
|
|
299
303
|
if (!canSend) return;
|
|
300
304
|
const sentDraft = draft;
|
|
@@ -306,6 +310,10 @@ function FeedbackComposer({
|
|
|
306
310
|
});
|
|
307
311
|
};
|
|
308
312
|
const config = attachment === true ? {} : attachment || null;
|
|
313
|
+
const slot = typeof attachmentSlot === "function" ? (
|
|
314
|
+
// eslint-disable-next-line react-hooks/refs -- handed on for an effect, not read here
|
|
315
|
+
attachmentSlot({ root, pending })
|
|
316
|
+
) : attachmentSlot;
|
|
309
317
|
return /* @__PURE__ */ jsxs("div", { ...rootAttributes, ref: root, className: cn("space-y-2", className), children: [
|
|
310
318
|
/* @__PURE__ */ jsx(
|
|
311
319
|
Textarea,
|
|
@@ -314,6 +322,9 @@ function FeedbackComposer({
|
|
|
314
322
|
dir: "auto",
|
|
315
323
|
"aria-label": labels.field,
|
|
316
324
|
"aria-describedby": size === "sm" ? hintId : void 0,
|
|
325
|
+
maxLength,
|
|
326
|
+
...showCount !== void 0 ? { showCount } : null,
|
|
327
|
+
countLabels,
|
|
317
328
|
ref: box,
|
|
318
329
|
placeholder: placeholder ?? labels.placeholder,
|
|
319
330
|
value: draft,
|
|
@@ -330,7 +341,7 @@ function FeedbackComposer({
|
|
|
330
341
|
}
|
|
331
342
|
),
|
|
332
343
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-end justify-between gap-2", children: [
|
|
333
|
-
config ||
|
|
344
|
+
config || slot != null ? /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-wrap items-end gap-2", children: [
|
|
334
345
|
config && /* @__PURE__ */ jsx(
|
|
335
346
|
FeedbackAttachmentField,
|
|
336
347
|
{
|
|
@@ -341,10 +352,12 @@ function FeedbackComposer({
|
|
|
341
352
|
maxBytes: config.maxBytes,
|
|
342
353
|
onError: config.onError,
|
|
343
354
|
onCaptureScreenshot: config.onCaptureScreenshot,
|
|
355
|
+
buttonVariant: config.buttonVariant,
|
|
356
|
+
buttonSize: config.buttonSize,
|
|
344
357
|
pasteFrom: root
|
|
345
358
|
}
|
|
346
359
|
),
|
|
347
|
-
|
|
360
|
+
slot
|
|
348
361
|
] }) : /* @__PURE__ */ jsx("span", {}),
|
|
349
362
|
/* @__PURE__ */ jsxs("div", { className: "ms-auto flex items-center gap-2", children: [
|
|
350
363
|
/* @__PURE__ */ jsx(
|