@revikornmann/muka-ui 0.9.2 → 0.10.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/dist/cjs/components/ChatComposer/ChatComposer.css +52 -61
- package/dist/cjs/components/ChatComposer/ChatComposer.js +29 -6
- package/dist/cjs/components/ChatComposer/ChatComposer.js.map +1 -1
- package/dist/cjs/components/ChatComposer/index.js +6 -1
- package/dist/cjs/components/ChatComposer/index.js.map +1 -1
- package/dist/esm/components/ChatComposer/ChatComposer.css +52 -61
- package/dist/esm/components/ChatComposer/ChatComposer.js +29 -6
- package/dist/esm/components/ChatComposer/ChatComposer.js.map +1 -1
- package/dist/esm/components/ChatComposer/index.js +1 -0
- package/dist/esm/components/ChatComposer/index.js.map +1 -1
- package/dist/styles/components/ChatComposer.css +52 -61
- package/dist/styles/index.css +2650 -2659
- package/dist/styles/muka-dark.css +2650 -2659
- package/dist/styles/muka-light.css +2650 -2659
- package/dist/styles/wireframe-dark.css +2650 -2659
- package/dist/styles/wireframe-light.css +2650 -2659
- package/dist/types/components/ChatComposer/ChatComposer.d.ts +50 -18
- package/dist/types/components/ChatComposer/ChatComposer.d.ts.map +1 -1
- package/dist/types/components/ChatComposer/index.d.ts +1 -0
- package/dist/types/components/ChatComposer/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { type IconName } from '../Icon';
|
|
2
3
|
import './ChatComposer.css';
|
|
3
4
|
export interface ChatComposerProps {
|
|
4
5
|
/** Current text value (controlled) */
|
|
@@ -10,30 +11,58 @@ export interface ChatComposerProps {
|
|
|
10
11
|
/** Placeholder. Default: 'Reply...' */
|
|
11
12
|
placeholder?: string;
|
|
12
13
|
/**
|
|
13
|
-
*
|
|
14
|
+
* Called when the leading button is pressed (attach / add). While `recording`
|
|
15
|
+
* the leading button becomes a discard control and calls `onRecordDiscard`
|
|
16
|
+
* instead.
|
|
14
17
|
*/
|
|
15
|
-
|
|
18
|
+
onLeadingClick?: () => void;
|
|
19
|
+
/** Leading button icon (RemixIcon base name). Default: 'add' */
|
|
20
|
+
leadingIcon?: IconName;
|
|
21
|
+
/** Leading button aria-label. Default: 'Add attachment' */
|
|
22
|
+
leadingLabel?: string;
|
|
23
|
+
/** Called when the in-field emoji button is pressed */
|
|
24
|
+
onEmoji?: () => void;
|
|
25
|
+
/** Show the in-field emoji button. Default: true */
|
|
26
|
+
showEmoji?: boolean;
|
|
27
|
+
/** Emoji button aria-label. Default: 'Add emoji' */
|
|
28
|
+
emojiLabel?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Called when the mic button is pressed. The mic button only appears when the
|
|
31
|
+
* field is empty and this handler is provided; otherwise a send button shows.
|
|
32
|
+
*/
|
|
33
|
+
onRecordStart?: () => void;
|
|
34
|
+
/** Mic button aria-label. Default: 'Record voice message' */
|
|
35
|
+
micLabel?: string;
|
|
36
|
+
/** Send button aria-label. Default: 'Send message' */
|
|
37
|
+
sendLabel?: string;
|
|
38
|
+
/** When true, the composer switches to the voice-recording layout */
|
|
39
|
+
recording?: boolean;
|
|
16
40
|
/**
|
|
17
|
-
*
|
|
41
|
+
* Content of the recording bar (e.g. a timer + waveform). Rendered inside the
|
|
42
|
+
* bordered card. The app owns recording state and this visualization.
|
|
18
43
|
*/
|
|
19
|
-
|
|
44
|
+
recordingSlot?: React.ReactNode;
|
|
45
|
+
/** Called when the pause button is pressed (recording only) */
|
|
46
|
+
onRecordPause?: () => void;
|
|
47
|
+
/** Called when the discard (leading) button is pressed while recording */
|
|
48
|
+
onRecordDiscard?: () => void;
|
|
49
|
+
/** Pause button aria-label. Default: 'Pause recording' */
|
|
50
|
+
pauseLabel?: string;
|
|
51
|
+
/** Discard button aria-label. Default: 'Discard recording' */
|
|
52
|
+
discardLabel?: string;
|
|
20
53
|
/**
|
|
21
|
-
*
|
|
54
|
+
* Staged attachments, typically `Thumbnail` tiles. Rendered in a horizontal
|
|
55
|
+
* scroll strip above the input row.
|
|
22
56
|
*/
|
|
23
|
-
|
|
24
|
-
/**
|
|
57
|
+
attachments?: React.ReactNode;
|
|
58
|
+
/** Overflow (scroll) button aria-label. Default: 'Show more attachments' */
|
|
59
|
+
attachmentsOverflowLabel?: string;
|
|
60
|
+
/** When true, shows a Spinner in place of the send button icon */
|
|
25
61
|
loading?: boolean;
|
|
26
62
|
/** Disabled state */
|
|
27
63
|
disabled?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
|
|
30
|
-
* via `trailing`, or want submit-on-enter only).
|
|
31
|
-
*/
|
|
32
|
-
hideSendButton?: boolean;
|
|
33
|
-
/** Send button aria-label. Default: 'Send message' */
|
|
34
|
-
sendLabel?: string;
|
|
35
|
-
/** Maximum height (px) before the textarea scrolls. Default: 160 */
|
|
36
|
-
maxHeight?: number;
|
|
64
|
+
/** Maximum number of text lines before the textarea scrolls. Default: 10 */
|
|
65
|
+
maxLines?: number;
|
|
37
66
|
/** Auto-focus on mount */
|
|
38
67
|
autoFocus?: boolean;
|
|
39
68
|
/** Additional CSS classes */
|
|
@@ -42,8 +71,11 @@ export interface ChatComposerProps {
|
|
|
42
71
|
/**
|
|
43
72
|
* ChatComposer — input affordance for chat conversations.
|
|
44
73
|
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
74
|
+
* A horizontal row of `[leading button] · [input field] · [trailing button]`.
|
|
75
|
+
* The trailing button toggles between a mic (empty field) and a send button
|
|
76
|
+
* (text entered). Supports a voice-recording layout and a staged-attachments
|
|
77
|
+
* strip. Submits on Enter (Shift+Enter for a newline). Designed to live in a
|
|
78
|
+
* `BottomBar`.
|
|
47
79
|
*/
|
|
48
80
|
export declare const ChatComposer: React.ForwardRefExoticComponent<ChatComposerProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
49
81
|
export default ChatComposer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatComposer.d.ts","sourceRoot":"","sources":["../../../../components/ChatComposer/ChatComposer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C1E,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAE7B,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE9B,4EAA4E;IAC5E,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAElC,kEAAkE;IAClE,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,0BAA0B;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,+FA2MxB,CAAC;AAIF,eAAe,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/ChatComposer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/ChatComposer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC"}
|
package/package.json
CHANGED