@revikornmann/muka-ui 0.9.2 → 0.11.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 (41) hide show
  1. package/dist/cjs/components/BottomBar/BottomBar.css +24 -2
  2. package/dist/cjs/components/BottomBar/BottomBar.js +1 -0
  3. package/dist/cjs/components/BottomBar/BottomBar.js.map +1 -1
  4. package/dist/cjs/components/ChatComposer/ChatComposer.css +52 -61
  5. package/dist/cjs/components/ChatComposer/ChatComposer.js +29 -6
  6. package/dist/cjs/components/ChatComposer/ChatComposer.js.map +1 -1
  7. package/dist/cjs/components/ChatComposer/index.js +6 -1
  8. package/dist/cjs/components/ChatComposer/index.js.map +1 -1
  9. package/dist/esm/components/BottomBar/BottomBar.css +24 -2
  10. package/dist/esm/components/BottomBar/BottomBar.js +1 -0
  11. package/dist/esm/components/BottomBar/BottomBar.js.map +1 -1
  12. package/dist/esm/components/ChatComposer/ChatComposer.css +52 -61
  13. package/dist/esm/components/ChatComposer/ChatComposer.js +29 -6
  14. package/dist/esm/components/ChatComposer/ChatComposer.js.map +1 -1
  15. package/dist/esm/components/ChatComposer/index.js +1 -0
  16. package/dist/esm/components/ChatComposer/index.js.map +1 -1
  17. package/dist/styles/components/BottomBar.css +24 -2
  18. package/dist/styles/components/ChatComposer.css +52 -61
  19. package/dist/styles/index.css +2771 -2757
  20. package/dist/styles/muka-dark.css +2771 -2757
  21. package/dist/styles/muka-light.css +2771 -2757
  22. package/dist/styles/tokens-bouwplan-dark.css +3 -2
  23. package/dist/styles/tokens-bouwplan-light.css +3 -2
  24. package/dist/styles/tokens-fscl-dark.css +3 -2
  25. package/dist/styles/tokens-fscl-light.css +3 -2
  26. package/dist/styles/tokens-grip-dark.css +3 -2
  27. package/dist/styles/tokens-grip-light.css +3 -2
  28. package/dist/styles/tokens-muka-dark.css +3 -2
  29. package/dist/styles/tokens-muka-light.css +3 -2
  30. package/dist/styles/tokens-wireframe-dark.css +3 -2
  31. package/dist/styles/tokens-wireframe-light.css +3 -2
  32. package/dist/styles/wireframe-dark.css +2771 -2757
  33. package/dist/styles/wireframe-light.css +2771 -2757
  34. package/dist/types/components/BottomBar/BottomBar.d.ts +3 -2
  35. package/dist/types/components/BottomBar/BottomBar.d.ts.map +1 -1
  36. package/dist/types/components/ChatComposer/ChatComposer.d.ts +50 -18
  37. package/dist/types/components/ChatComposer/ChatComposer.d.ts.map +1 -1
  38. package/dist/types/components/ChatComposer/index.d.ts +1 -0
  39. package/dist/types/components/ChatComposer/index.d.ts.map +1 -1
  40. package/package.json +1 -1
  41. package/tokens/t4-components/bottombar.json +11 -5
@@ -1,27 +1,38 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { forwardRef, useEffect, useImperativeHandle, useRef, } from 'react';
4
+ import { Button } from '../Button';
4
5
  import { Icon } from '../Icon';
5
6
  import { Spinner } from '../Spinner';
6
7
  import './ChatComposer.css';
7
8
  /**
8
9
  * ChatComposer — input affordance for chat conversations.
9
10
  *
10
- * Auto-growing textarea with a send button. Submits on Enter (Shift+Enter for
11
- * newline). Designed to live in a `BottomBar`.
11
+ * A horizontal row of `[leading button] · [input field] · [trailing button]`.
12
+ * The trailing button toggles between a mic (empty field) and a send button
13
+ * (text entered). Supports a voice-recording layout and a staged-attachments
14
+ * strip. Submits on Enter (Shift+Enter for a newline). Designed to live in a
15
+ * `BottomBar`.
12
16
  */
13
- export const ChatComposer = forwardRef(({ value, onChange, onSubmit, placeholder = 'Reply...', attachments, leading, trailing, loading = false, disabled = false, hideSendButton = false, sendLabel = 'Send message', maxHeight = 160, autoFocus = false, className = '', }, forwardedRef) => {
17
+ export const ChatComposer = forwardRef(({ value, onChange, onSubmit, placeholder = 'Reply...', onLeadingClick, leadingIcon = 'add', leadingLabel = 'Add attachment', onEmoji, showEmoji = true, emojiLabel = 'Add emoji', onRecordStart, micLabel = 'Record voice message', sendLabel = 'Send message', recording = false, recordingSlot, onRecordPause, onRecordDiscard, pauseLabel = 'Pause recording', discardLabel = 'Discard recording', attachments, attachmentsOverflowLabel = 'Show more attachments', loading = false, disabled = false, maxLines = 10, autoFocus = false, className = '', }, forwardedRef) => {
14
18
  const textareaRef = useRef(null);
19
+ const attachmentsRef = useRef(null);
15
20
  useImperativeHandle(forwardedRef, () => textareaRef.current);
21
+ // Auto-grow the textarea up to `maxLines`, then scroll.
16
22
  useEffect(() => {
17
23
  const el = textareaRef.current;
18
24
  if (!el)
19
25
  return;
20
26
  el.style.height = 'auto';
27
+ const lineHeight = parseFloat(getComputedStyle(el).lineHeight) || 20;
28
+ const maxHeight = lineHeight * maxLines;
21
29
  const next = Math.min(el.scrollHeight, maxHeight);
22
30
  el.style.height = `${next}px`;
23
- }, [value, maxHeight]);
24
- const canSubmit = !disabled && !loading && value.trim().length > 0;
31
+ el.style.overflowY = el.scrollHeight > maxHeight ? 'auto' : 'hidden';
32
+ }, [value, maxLines, recording]);
33
+ const canSubmit = recording
34
+ ? !disabled && !loading
35
+ : !disabled && !loading && value.trim().length > 0;
25
36
  const handleSubmit = () => {
26
37
  if (!canSubmit)
27
38
  return;
@@ -33,8 +44,18 @@ export const ChatComposer = forwardRef(({ value, onChange, onSubmit, placeholder
33
44
  handleSubmit();
34
45
  }
35
46
  };
47
+ const scrollAttachments = () => {
48
+ const el = attachmentsRef.current;
49
+ if (!el)
50
+ return;
51
+ el.scrollBy({ left: el.clientWidth * 0.8, behavior: 'smooth' });
52
+ };
53
+ // Trailing button is a mic only when the field is empty, not recording, and
54
+ // a record handler is supplied; otherwise it is the send button.
55
+ const showMic = !recording && onRecordStart && value.trim().length === 0;
36
56
  const classes = [
37
57
  'muka-chat-composer',
58
+ recording && 'muka-chat-composer--recording',
38
59
  disabled && 'muka-chat-composer--disabled',
39
60
  className,
40
61
  ]
@@ -43,7 +64,9 @@ export const ChatComposer = forwardRef(({ value, onChange, onSubmit, placeholder
43
64
  return (_jsxs("form", { className: classes, onSubmit: (e) => {
44
65
  e.preventDefault();
45
66
  handleSubmit();
46
- }, children: [attachments && (_jsx("div", { className: "muka-chat-composer__attachments", children: attachments })), _jsx("div", { className: "muka-chat-composer__row", children: _jsx("textarea", { ref: textareaRef, className: "muka-chat-composer__input", value: value, onChange: (e) => onChange(e.target.value), onKeyDown: handleKeyDown, placeholder: placeholder, disabled: disabled, autoFocus: autoFocus, rows: 1, "aria-label": placeholder }) }), (leading || (!hideSendButton && (trailing || true))) && (_jsxs("div", { className: "muka-chat-composer__actions", children: [_jsx("div", { className: "muka-chat-composer__leading", children: leading }), _jsx("div", { className: "muka-chat-composer__trailing", children: trailing ?? (!hideSendButton && (_jsx("button", { type: "submit", className: "muka-chat-composer__send", disabled: !canSubmit, "aria-label": sendLabel, children: loading ? (_jsx(Spinner, { size: "sm", variant: "inverse" })) : (_jsx(Icon, { name: "arrow-up", size: "sm" })) }))) })] }))] }));
67
+ }, children: [attachments && (_jsxs("div", { className: "muka-chat-composer__attachments-strip", children: [_jsx("div", { className: "muka-chat-composer__attachments", ref: attachmentsRef, children: attachments }), _jsx(Button, { type: "button", className: "muka-chat-composer__overflow", variant: "secondary", size: "sm", iconOnly: true, "aria-label": attachmentsOverflowLabel, onClick: scrollAttachments, children: _jsx(Icon, { name: "arrow-right-s", size: "xs" }) })] })), _jsxs("div", { className: "muka-chat-composer__row", children: [_jsx(Button, { type: "button", variant: "secondary", size: "lg", iconOnly: true, disabled: disabled, "aria-label": recording ? discardLabel : leadingLabel, onClick: recording ? onRecordDiscard : onLeadingClick, children: _jsx(Icon, { name: recording ? 'delete-bin' : leadingIcon, size: "md" }) }), recording ? (_jsx("div", { className: "muka-chat-composer__recording", children: recordingSlot })) : (_jsxs("div", { className: "muka-chat-composer__field", children: [_jsx("textarea", { ref: textareaRef, className: "muka-chat-composer__input", value: value, onChange: (e) => onChange(e.target.value), onKeyDown: handleKeyDown, placeholder: placeholder, disabled: disabled,
68
+ // eslint-disable-next-line jsx-a11y/no-autofocus
69
+ autoFocus: autoFocus, rows: 1, "aria-label": placeholder }), showEmoji && (_jsx(Button, { type: "button", className: "muka-chat-composer__emoji", variant: "ghost", size: "md", iconOnly: true, disabled: disabled, "aria-label": emojiLabel, onClick: onEmoji, children: _jsx(Icon, { name: "emotion-happy", size: "sm" }) }))] })), recording && (_jsx(Button, { type: "button", variant: "secondary", size: "lg", iconOnly: true, disabled: disabled, "aria-label": pauseLabel, onClick: onRecordPause, children: _jsx(Icon, { name: "pause-circle", size: "md" }) })), showMic ? (_jsx(Button, { type: "button", variant: "secondary", size: "lg", iconOnly: true, disabled: disabled, "aria-label": micLabel, onClick: onRecordStart, children: _jsx(Icon, { name: "mic", size: "md" }) })) : (_jsx(Button, { type: "submit", variant: "primary", size: "lg", iconOnly: true, disabled: !canSubmit, "aria-label": sendLabel, children: loading ? (_jsx(Spinner, { size: "sm", variant: "inverse" })) : (_jsx(Icon, { name: "send-plane2", size: "md" })) }))] })] }));
47
70
  });
48
71
  ChatComposer.displayName = 'ChatComposer';
49
72
  export default ChatComposer;
@@ -1 +1 @@
1
- {"version":3,"file":"ChatComposer.js","sourceRoot":"","sources":["../../../../components/ChatComposer/ChatComposer.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAc,EACZ,UAAU,EACV,SAAS,EACT,mBAAmB,EACnB,MAAM,GACP,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,oBAAoB,CAAC;AAuD5B;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CACpC,CACE,EACE,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,WAAW,GAAG,UAAU,EACxB,WAAW,EACX,OAAO,EACP,QAAQ,EACR,OAAO,GAAG,KAAK,EACf,QAAQ,GAAG,KAAK,EAChB,cAAc,GAAG,KAAK,EACtB,SAAS,GAAG,cAAc,EAC1B,SAAS,G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,WAAW,GAAG,cAAc,CAAC;AAE1C,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"ChatComposer.js","sourceRoot":"","sources":["../../../../components/ChatComposer/ChatComposer.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAc,EACZ,UAAU,EACV,SAAS,EACT,mBAAmB,EACnB,MAAM,GACP,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,IAAI,EAAiB,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,oBAAoB,CAAC;AA+F5B;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CACpC,CACE,EACE,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,WAAW,GAAG,UAAU,EACxB,cAAc,EACd,WAAW,GAAG,KAAK,EACnB,YAAY,GAAG,gBAAgB,EAC/B,OAAO,EACP,SAAS,GAAG,IAAI,EAChB,UAAU,GAAG,WAAW,EACxB,aAAa,EACb,QAAQ,GAAG,sBAAsB,EACjC,SAAS,GAAG,cAAc,EAC1B,SAAS,GAAG,KAAK,EACjB,aAAa,EACb,aAAa,EACb,eAAe,EACf,UAAU,GAAG,iBAAiB,EAC9B,YAAY,GAAG,mBAAmB,EAClC,WAAW,EACX,wBAAwB,GAAG,uBAAuB,EAClD,OAAO,GAAG,KAAK,EACf,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,EAAE,EACb,SAAS,GAAG,KAAK,EACjB,SAAS,GAAG,EAAE,GACf,EACD,YAAY,EACZ,EAAE;IACF,MAAM,WAAW,GAAG,MAAM,CAAsB,IAAI,CAAC,CAAC;IACtD,MAAM,cAAc,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IACpD,mBAAmB,CAAC,YAAY,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,OAA8B,CAAC,CAAC;IAEpF,wDA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AAE,aAAa,YAEtB,KAAC,IAAI,IAAC,IAAI,EAAC,cAAc,EAAC,IAAI,EAAC,IAAI,GAAG,GAC/B,CACV,EAEA,OAAO,CAAC,CAAC,CAAC,CACT,KAAC,MAAM,IACL,IAAI,EAAC,QAAQ,EACb,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,IAAI,EACT,QAAQ,QACR,QAAQ,EAAE,QAAQ,gBACN,QAAQ,EACpB,OAAO,EAAE,aAAa,YAEtB,KAAC,IAAI,IAAC,IAAI,EAAC,KAAK,EAAC,IAAI,EAAC,IAAI,GAAG,GACtB,CACV,CAAC,CAAC,CAAC,CACF,KAAC,MAAM,IACL,IAAI,EAAC,QAAQ,EACb,OAAO,EAAC,SAAS,EACjB,IAAI,EAAC,IAAI,EACT,QAAQ,QACR,QAAQ,EAAE,CAAC,SAAS,gBACR,SAAS,YAEpB,OAAO,CAAC,CAAC,CAAC,CACT,KAAC,OAAO,IAAC,IAAI,EAAC,IAAI,EAAC,OAAO,EAAC,SAAS,GAAG,CACxC,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,IAAC,IAAI,EAAC,aAAa,EAAC,IAAI,EAAC,IAAI,GAAG,CACtC,GACM,CACV,IACG,IACD,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC;AAE1C,eAAe,YAAY,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export { ChatComposer } from './ChatComposer';
2
+ export { default } from './ChatComposer';
2
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../components/ChatComposer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA0B,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../components/ChatComposer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA0B,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC"}
@@ -62,6 +62,30 @@
62
62
  flex-direction: row;
63
63
  }
64
64
 
65
+ /* ─── Chat variant (houses a ChatComposer) ───────────── */
66
+
67
+ .muka-bottombar--chat .muka-bottombar__content {
68
+ flex-direction: row;
69
+ max-width: var(--bottombar-chat-max-width);
70
+ width: 100%;
71
+ margin: 0 auto;
72
+ }
73
+
74
+ /* Docked chat pads its content; the floating card supplies its own padding. */
75
+ .muka-bottombar--chat:not(.muka-bottombar--floating) .muka-bottombar__content {
76
+ padding: var(--bottombar-chat-padding);
77
+ }
78
+
79
+ /* Floating chat card widens to the chat cap (overrides the md default below). */
80
+ .muka-bottombar--chat.muka-bottombar--floating .muka-bottombar__content {
81
+ max-width: var(--bottombar-chat-max-width);
82
+ }
83
+
84
+ /* Let the composer fill the wider bar instead of its standalone 768px cap. */
85
+ .muka-bottombar--chat .muka-chat-composer {
86
+ max-width: none;
87
+ }
88
+
65
89
  /* ─── Tab item ────────────────────────────────────────── */
66
90
 
67
91
  .muka-bottombar__tab {
@@ -118,8 +142,6 @@
118
142
  var(--bottombar-floating-backdrop-start),
119
143
  var(--bottombar-floating-backdrop-end)
120
144
  );
121
- backdrop-filter: blur(var(--bottombar-floating-backdrop-blur));
122
- -webkit-backdrop-filter: blur(var(--bottombar-floating-backdrop-blur));
123
145
  padding: var(--bottombar-floating-padding-top) var(--bottombar-floating-margin-x) var(--bottombar-floating-margin-bottom);
124
146
 
125
147
  /* The transparent frosted margin around the pill overlays scrolling content;
@@ -3,15 +3,9 @@
3
3
  .muka-chat-composer {
4
4
  display: flex;
5
5
  flex-direction: column;
6
- gap: var(--spacing-2);
6
+ gap: var(--spacing-3);
7
7
  width: 100%;
8
8
  max-width: 768px;
9
- padding: var(--spacing-3);
10
- background-color: var(--color-surface-level3);
11
- border-radius: var(--radius-xl);
12
- box-shadow:
13
- 0 0 0.5px var(--color-black-alpha-5, rgba(0, 0, 0, 0.09)),
14
- 0 8px 8px var(--color-black-alpha-5, rgba(0, 0, 0, 0.09));
15
9
  }
16
10
 
17
11
  .muka-chat-composer--disabled {
@@ -19,28 +13,33 @@
19
13
  pointer-events: none;
20
14
  }
21
15
 
22
- /* ─── Staged attachments slot ──────────────────────────── */
16
+ /* ─── Input row ────────────────────────────────────────── */
23
17
 
24
- .muka-chat-composer__attachments {
18
+ .muka-chat-composer__row {
25
19
  display: flex;
26
- flex-wrap: wrap;
27
- gap: var(--spacing-2);
20
+ width: 100%;
21
+ align-items: flex-end;
22
+ gap: var(--spacing-3);
28
23
  }
29
24
 
30
- /* ─── Input row ────────────────────────────────────────── */
25
+ /* ─── Text field ───────────────────────────────────────── */
31
26
 
32
- .muka-chat-composer__row {
27
+ .muka-chat-composer__field {
33
28
  display: flex;
34
- width: 100%;
35
- align-items: stretch;
29
+ flex: 1 1 auto;
30
+ min-width: 0;
31
+ box-sizing: border-box;
32
+ align-items: center;
33
+ gap: var(--spacing-1);
34
+ min-height: var(--input-field-height-lg, 48px);
35
+ padding: 0 var(--spacing-2);
36
36
  border: var(--border-width-regular) solid var(--input-field-color-default-border);
37
37
  border-radius: var(--input-field-radius-lg);
38
38
  background-color: var(--input-field-color-default-background);
39
- padding: var(--spacing-2);
40
39
  transition: border-color 0.12s ease;
41
40
  }
42
41
 
43
- .muka-chat-composer__row:focus-within {
42
+ .muka-chat-composer__field:focus-within {
44
43
  border-color: var(--input-field-color-focus-border, var(--color-action-default));
45
44
  }
46
45
 
@@ -48,16 +47,17 @@
48
47
  flex: 1 1 auto;
49
48
  min-width: 0;
50
49
  width: 100%;
50
+ box-sizing: border-box;
51
51
  resize: none;
52
52
  border: none;
53
53
  background: transparent;
54
54
  outline: none;
55
- padding: var(--spacing-1) var(--spacing-2);
55
+ padding: 0 var(--spacing-1);
56
56
  color: var(--color-text-default-default);
57
- font-family: var(--text-body-md-regular-fontFamily);
58
- font-weight: var(--text-body-md-regular-fontWeight);
59
- font-size: var(--text-body-md-regular-fontSize);
60
- line-height: var(--text-body-md-regular-lineHeight);
57
+ font-family: var(--text-body-base-regular-fontFamily);
58
+ font-weight: var(--text-body-base-regular-fontWeight);
59
+ font-size: var(--text-body-base-regular-fontSize);
60
+ line-height: var(--text-body-base-regular-lineHeight);
61
61
  appearance: none;
62
62
  -webkit-appearance: none;
63
63
  }
@@ -66,57 +66,48 @@
66
66
  color: var(--color-text-subtle-default);
67
67
  }
68
68
 
69
- /* ─── Actions row (leading + trailing) ─────────────────── */
70
-
71
- .muka-chat-composer__actions {
72
- display: flex;
73
- align-items: center;
74
- justify-content: space-between;
75
- gap: var(--spacing-2);
69
+ /* Keep the in-field emoji button flush to the bottom-right as the field grows */
70
+ .muka-chat-composer__emoji {
71
+ flex-shrink: 0;
76
72
  }
77
73
 
78
- .muka-chat-composer__leading {
79
- display: flex;
80
- align-items: center;
81
- gap: var(--spacing-1);
82
- }
74
+ /* ─── Recording bar ────────────────────────────────────── */
83
75
 
84
- .muka-chat-composer__trailing {
76
+ .muka-chat-composer__recording {
85
77
  display: flex;
78
+ flex: 1 1 auto;
79
+ min-width: 0;
80
+ box-sizing: border-box;
86
81
  align-items: center;
87
- gap: var(--spacing-1);
88
- margin-left: auto;
82
+ min-height: var(--input-field-height-lg, 48px);
83
+ padding: var(--card-padding-sm);
84
+ border: var(--border-width-regular) solid var(--card-color-default-border);
85
+ border-radius: var(--radius-lg);
86
+ background-color: var(--card-color-default-background);
89
87
  }
90
88
 
91
- /* ─── Send button ──────────────────────────────────────── */
89
+ /* ─── Staged attachments strip ─────────────────────────── */
92
90
 
93
- .muka-chat-composer__send {
94
- display: inline-flex;
95
- align-items: center;
96
- justify-content: center;
97
- width: var(--size-3xl, 40px);
98
- height: var(--size-3xl, 40px);
99
- border: none;
100
- border-radius: var(--radius-lg);
101
- background-color: var(--button-color-primary-background-default);
102
- color: var(--button-color-primary-foreground-default);
103
- cursor: pointer;
104
- flex-shrink: 0;
105
- -webkit-tap-highlight-color: transparent;
106
- transition: background-color 0.12s ease;
91
+ .muka-chat-composer__attachments-strip {
92
+ position: relative;
93
+ width: 100%;
107
94
  }
108
95
 
109
- .muka-chat-composer__send:hover:not(:disabled) {
110
- background-color: var(--button-color-primary-background-hover, var(--button-color-primary-background-default));
96
+ .muka-chat-composer__attachments {
97
+ display: flex;
98
+ gap: var(--spacing-3);
99
+ overflow-x: auto;
100
+ scroll-behavior: smooth;
101
+ scrollbar-width: none;
111
102
  }
112
103
 
113
- .muka-chat-composer__send:disabled {
114
- background-color: var(--color-surface-level1);
115
- color: var(--color-text-subtle-default);
116
- cursor: not-allowed;
104
+ .muka-chat-composer__attachments::-webkit-scrollbar {
105
+ display: none;
117
106
  }
118
107
 
119
- .muka-chat-composer__send:focus-visible {
120
- outline: 2px solid var(--color-action-default);
121
- outline-offset: 2px;
108
+ .muka-chat-composer__overflow {
109
+ position: absolute;
110
+ top: 50%;
111
+ right: var(--spacing-2);
112
+ transform: translateY(-50%);
122
113
  }